﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace CrossingSwords
{
    class Player
    {
        String name;
        Vector2 position;
        int hp, vp, index;
        Card playedCard;
        String focuses = null;
        bool isAI, halted;

        public Player(String name, Vector2 pos, int index, bool AI)
        {
            this.name = name;
            position = pos;
            this.index = index;
            isAI = AI;
            hp = 20;
            vp = 0;
            halted = false;
        }

        public bool IsHalted()
        {
            return halted;
        }
        public void ChangeHaltedState()
        {
            halted = !halted;
        }
        public void SetCard(Card selectedCard)
        {
            playedCard = selectedCard;
        }
        public String GetName()
        {
            return name;
        }
        public String IsFocusing()
        {
            return focuses;
        }
        public void SetCardPos(SpriteFont font)
        {
            playedCard.position = position + new Vector2(font.MeasureString("hp: 999").X, font.MeasureString(name).Y);
        }

        public void Draw(SpriteBatch render,SpriteFont font, bool revealCard)
        {
            render.DrawString(font, name, position, Color.Black);
            render.DrawString(font, "hp: "+hp, position+new Vector2(0,font.MeasureString(name).Y), Color.Black);
            render.DrawString(font, "vp: "+vp, position + new Vector2(0, font.MeasureString(name).Y+font.MeasureString("hp").Y), Color.Black);
            playedCard.Draw(render,revealCard);
        }

    }
}
